﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp6
{
    class Triangle
    {
        private float a;
        private float b;
        private float c;
        public float A
        {
            get { return a; }
            set { a = value; }
        }
        public float B
        {
            get { return b; }
            set { b = value; }
        }
        public float C
        {
            get { return c; }
            set { c = value; }
        }
        public Triangle(float x, float y, float z)
        {
            if ((x <= 0 || y <= 0 || z <= 0)&&((x+y<=z)|| (x+z<=y) || (y+z<=x))) throw new ArgumentException("边长参数异常");
            a = x;
            b = y;
            c = z;
        }
        public double Perimeter { get {return a+b+c; } }
        public double Area { get { return Math.Sqrt(Perimeter / 2 * (Perimeter / 2 - a) * (Perimeter / 2 - b) * (Perimeter / 2 - c)); } }

    }
}
